import subprocess

def simulate_keyevent(event_code):
    result = subprocess.run(
        ["adb", "shell", "input", "keyevent", str(event_code)],
        stdout=subprocess.PIPE,
        text=True
    )
    if result.returncode == 0:
        print(f"成功模拟按键事件：{event_code}")
    else:
        print(f"模拟按键事件失败：{event_code}")

# 模拟Enter键
simulate_keyevent(66)

# 模拟Back键
simulate_keyevent(4)

# 模拟Home键
simulate_keyevent(3)